package net.homeip.jcperera.webinfo;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.inject.Named;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import net.homeip.jcperera.nu.model.entity.PersistentEntity;

@Entity
@Table(name = WebInfoSite.tableName)
@Named(WebInfoSite.componentName)
@Inheritance(strategy = InheritanceType.JOINED)
public class WebInfoSite extends PersistentEntity implements Serializable
{
    private static final long  serialVersionUID = -2346677893562361058L;

    // CoreBase properties, for easy use from other components, as well as logging
    public static final int    runtimeLevel     = 5;
    public static final String moduleName       = "webinfo";
    public static final String componentName    = "webinfo_webinfosite";

    // All persistent entities should specify a table name
    public static final String tableName        = "WEB_INFO_SITE";

    @Basic
    @Column(name = "URL")
    private String             url              = "";

    @Basic
    @Column(name = "PARAMETERS")
    private String             parameters       = "";
    
    @OneToMany(cascade=CascadeType.ALL,mappedBy="site")
    private Set<WebInfoPattern> webinfopatterns = new HashSet<WebInfoPattern>();
    
    @OneToMany(cascade=CascadeType.ALL,mappedBy="site")
    private Set<ScanProfile> scanprofiles = new HashSet<ScanProfile>();

    public String getUrl()
    {
        return url;
    }

    public void setUrl(String url)
    {
        this.url = url;
    }

    public String getParameters()
    {
        return parameters;
    }

    public void setParameters(String parameters)
    {
        this.parameters = parameters;
    }

    public Set<WebInfoPattern> getWebinfopatterns()
    {
        return webinfopatterns;
    }         
    
    public Set<ScanProfile> getScanProfiles()
    {
        return scanprofiles;
    }             
}
